/**
 * 获取url参数
 * @param {string} url
 * @return {*}
 */
export default function getUrlParams(url = window.location.search) {
  const params = {};
  const keys = url.match(/([^?&]+)(?==)/g);
  const values = url.match(/(?<==)([^&]*)/g);
  for (const index in keys) {
    params[keys[index]] = values[index];
  }
  return params;
}
